package org.hcf.data.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.hcf.data.entity.ChatNotReceiveMsg;
import org.hcf.data.mapper.ChatNotReceiveMsgMapper;
import org.hcf.data.service.IChatNotReceiveMsgService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xianiyitiao
 * @since 2024-04-25
 */
@Service
public class ChatNotReceiveMsgServiceImpl extends ServiceImpl<ChatNotReceiveMsgMapper, ChatNotReceiveMsg> implements IChatNotReceiveMsgService {

    @Override
    public List<ChatNotReceiveMsg> getMessageDatas(List<Long> msgIds,int msgCode) {
        return list(new LambdaQueryWrapper<ChatNotReceiveMsg>().eq(ChatNotReceiveMsg::getMsgCode,msgCode).in(ChatNotReceiveMsg::getMsgId,msgIds));
    }

    @Override
    public void removeMessages(List<Long> ids) {
        this.removeByIds(ids);
    }
}
